--[[
   Copyright 2007-2019 The OpenRA Developers (see AUTHORS)
   This file is part of OpenRA, which is free software. It is made
   available to you under the terms of the GNU General Public License
   as published by the Free Software Foundation, either version 3 of
   the License, or (at your option) any later version. For more
   information, see COPYING.
]]

pboxs = {Actor0, Actor1, Actor2, Actor3, Actor4, Actor5, Actor6, Actor7, Actor8, Actor9, Actor10, Actor11, Actor12, Actor13, Actor14, Actor15, Actor16, Actor17, Actor18, Actor19, Actor20, Actor21, Actor22, Actor23, Actor24, Actor25, Actor26, Actor27, Actor28, Actor29, Actor30, Actor31, Actor32, Actor33, Actor34, Actor35, Actor36, Actor37, Actor38, Actor39, 
   Actor40, Actor41, Actor42, Actor43, Actor44, Actor45, Actor46, Actor47, Actor48, Actor49, Actor50, Actor51, Actor52, Actor53, Actor54, Actor55, Actor56, Actor57, Actor58, Actor59, Actor60, Actor61, Actor62, Actor63, Actor64, Actor65, Actor66, Actor67, Actor68, Actor69, Actor70, Actor71, Actor72, Actor73, Actor74, Actor75, Actor76, Actor77, Actor78, Actor79, 
   Actor80, Actor81, Actor82, Actor83, Actor84, Actor85, Actor86, Actor87, Actor88, Actor89, Actor90, Actor91, Actor92, Actor93, Actor94, Actor95, Actor96, Actor97, Actor98, Actor99, Actor100, Actor101, Actor102, Actor103, Actor104, Actor105, Actor106, Actor107, Actor108, Actor109, Actor110, Actor111, Actor112, Actor113, Actor114, Actor115, Actor116, Actor117, Actor118, Actor119, 
   Actor120, Actor121, Actor122, Actor123, Actor124, Actor125, Actor126, Actor127, Actor128, Actor129, Actor130, Actor131, Actor132, Actor133, Actor134, Actor135, Actor136, Actor137, Actor138, Actor139, Actor140, Actor141, Actor142, Actor143, Actor144, Actor145, Actor146, Actor147, Actor148, Actor149, Actor150, Actor151, Actor152, Actor153, Actor154, Actor155, Actor156, Actor157, Actor158, Actor159, 
   Actor160, Actor161, Actor162, Actor163, Actor164, Actor165, Actor166, Actor167, Actor168, Actor169, Actor170, Actor171, Actor172, Actor173, Actor174, Actor175, Actor176, Actor177, Actor178, Actor179, Actor180, Actor181, Actor182, Actor183, Actor184, Actor185, Actor186, Actor187, Actor188, Actor189, Actor190, Actor191, Actor192, Actor193, Actor194, Actor195, Actor196, Actor197, Actor198, Actor199, 
   Actor200, Actor201, Actor202, Actor203, Actor204, Actor205, Actor206, Actor207, Actor208, Actor209, Actor210, Actor211, Actor212, Actor213, Actor214, Actor215, Actor216, Actor217, Actor218, Actor219, Actor220, Actor221, Actor222, Actor223, Actor224, Actor225, Actor226, Actor227, Actor228, Actor229, Actor230, Actor231, Actor232, Actor233, Actor234, Actor235, Actor236, Actor237, Actor238, Actor239, 
   Actor240, Actor241, Actor242, Actor243, Actor244, Actor245, Actor246, Actor247, Actor248, Actor249, Actor250, Actor251, Actor252, Actor253, Actor254, Actor255, Actor256, Actor257, Actor258, Actor259, Actor260, Actor261, Actor262, Actor263, Actor264, Actor265, Actor266, Actor267, Actor268, Actor269, Actor270, Actor271, Actor272, Actor273, Actor274, Actor275, Actor276, Actor277, Actor278, Actor279, 
   Actor280, Actor281, Actor282, Actor283, Actor284, Actor285, Actor286, Actor287, Actor288, Actor289, Actor290, Actor291, Actor292, Actor293, Actor294, Actor295, Actor296, Actor297, Actor298, Actor299, Actor300, Actor301, Actor302, Actor303, Actor304, Actor305, Actor306, Actor307, Actor308, Actor309, Actor310, Actor311, Actor312, Actor313, Actor314, Actor315, Actor316, Actor317, Actor318, Actor319, 
   Actor320, Actor321, Actor322, Actor323, Actor324, Actor325, Actor326, Actor327, Actor328, Actor329, Actor330, Actor331, Actor332, Actor333, Actor334, Actor335, Actor336, Actor337, Actor338, Actor339, Actor340, Actor341, Actor342, Actor343, Actor344, Actor345, Actor346, Actor347, Actor348, Actor349, Actor350, Actor351, Actor352, Actor353, Actor354, Actor355, Actor356, Actor357, Actor358, Actor359, 
   Actor360, Actor361, Actor362, Actor363, Actor364, Actor365, Actor366, Actor367, Actor368, Actor369, Actor370, Actor371, Actor372, Actor373, Actor374, Actor375, Actor376, Actor377, Actor378, Actor379, Actor380, Actor381, Actor382, Actor383, Actor384, Actor385, Actor386, Actor387, Actor388, Actor389, Actor390, Actor391, Actor392, Actor393, Actor394, Actor395, Actor396, Actor397, Actor398, Actor399, 
   Actor400, Actor401, Actor402, Actor403, Actor404, Actor405, Actor406, Actor407, Actor408, Actor409, Actor410, Actor411, Actor412, Actor413, Actor414, Actor415, Actor416, Actor417, Actor418, Actor419, Actor420, Actor421, Actor422, Actor423, Actor424, Actor425, Actor426, Actor427, Actor428, Actor429, Actor430, Actor431, Actor432, Actor433, Actor434, Actor435, Actor436, Actor437, Actor438, Actor439, 
   Actor440, Actor441, Actor442, Actor443, Actor444, Actor445, Actor446, Actor447, Actor448, Actor449, Actor450, Actor451, Actor452, Actor453, Actor454, Actor455, Actor456, Actor457, Actor458, Actor459, Actor460, Actor461, Actor462, Actor463, Actor464, Actor465, Actor466, Actor467, Actor468, Actor469, Actor470, Actor471, Actor472, Actor473, Actor474, Actor475, Actor476, Actor477, Actor478, Actor479, 
   Actor480, Actor481, Actor482, Actor483, Actor484, Actor485, Actor486, Actor487, Actor488, Actor489, Actor490, Actor491, Actor492, Actor493, Actor494, Actor495, Actor496, Actor497, Actor498, Actor499, Actor500, Actor501, Actor502, Actor503, Actor504, Actor505, Actor506, Actor507, Actor508, Actor509, Actor510, Actor511, Actor512, Actor513, Actor514, Actor515, Actor516, Actor517, Actor518, Actor519, 
   Actor520, Actor521, Actor522, Actor523, Actor524, Actor525, Actor526, Actor527, Actor528, Actor529, Actor530, Actor531, Actor532, Actor533, Actor534, Actor535, Actor536, Actor537, Actor538, Actor539, Actor540, Actor541, Actor542, Actor543, Actor544, Actor545, Actor546, Actor547, Actor548, Actor549, Actor550, Actor551, Actor552, Actor553, Actor554, Actor555, Actor556, Actor557, Actor558, Actor559, 
   Actor560, Actor561, Actor562, Actor563, Actor564, Actor565, Actor566, Actor567, Actor568, Actor569, Actor570, Actor571, Actor572, Actor573, Actor574, Actor575, Actor576, Actor577, Actor578, Actor579, Actor580, Actor581, Actor582, Actor583, Actor584, Actor585, Actor586, Actor587, Actor588, Actor589, Actor590, Actor591, Actor592, Actor593, Actor594, Actor595, Actor596, Actor597, Actor598, Actor599, 
   Actor600, Actor601, Actor602, Actor603, Actor604, Actor605, Actor606, Actor607, Actor608, Actor609, Actor610, Actor611, Actor612, Actor613, Actor614, Actor615, Actor616, Actor617, Actor618, Actor619, Actor620, Actor621, Actor622, Actor623, Actor624, Actor625, Actor626, Actor627, Actor628, Actor629, Actor630, Actor631, Actor632, Actor633, Actor634, Actor635, Actor636, Actor637, Actor638, Actor639, 
   Actor640, Actor641, Actor642, Actor643, Actor644, Actor645, Actor646, Actor647, Actor648, Actor649, Actor650, Actor651, Actor652, Actor653, Actor654, Actor655, Actor656, Actor657, Actor658, Actor659, Actor660, Actor661, Actor662, Actor663, Actor664, Actor665, Actor666, Actor667, Actor668, Actor669, Actor670, Actor671, Actor672, Actor673, Actor674, Actor675, Actor676, Actor677, Actor678, Actor679, 
   Actor680, Actor681, Actor682, Actor683, Actor684, Actor685, Actor686, Actor687, Actor688, Actor689, Actor690, Actor691, Actor692, Actor693, Actor694, Actor695, Actor696, Actor697, Actor698, Actor699, Actor700, Actor701, Actor702, Actor703, Actor704, Actor705, Actor706, Actor707, Actor708, Actor709, Actor710, Actor711, Actor712, Actor713, Actor714, Actor715, Actor716, Actor717, Actor718, Actor719, 
   Actor720, Actor721, Actor722, Actor723, Actor724, Actor725, Actor726, Actor727, Actor728, Actor729, Actor730, Actor731, Actor732, Actor733, Actor734, Actor735, Actor736, Actor737, Actor738, Actor739, Actor740, Actor741, Actor742, Actor743, Actor744, Actor745, Actor746, Actor747, Actor748, Actor749, Actor750, Actor751, Actor752, Actor753, Actor754, Actor755, Actor756, Actor757, Actor758, Actor759, 
   Actor760, Actor761, Actor762, Actor763, Actor764, Actor765, Actor766, Actor767, Actor768, Actor769, Actor770, Actor771, Actor772, Actor773, Actor774, Actor775, Actor776, Actor777, Actor778, Actor779, Actor780, Actor781, Actor782, Actor783, Actor784, Actor785, Actor786, Actor787, Actor788, Actor789, Actor790, Actor791, Actor792, Actor793, Actor794, Actor795, Actor796, Actor797, Actor798, Actor799, 
   Actor800, Actor801, Actor802, Actor803, Actor804, Actor805, Actor806, Actor807, Actor808, Actor809, Actor810, Actor811, Actor812, Actor813, Actor814, Actor815, Actor816, Actor817, Actor818, Actor819, Actor820, Actor821, Actor822, Actor823, Actor824, Actor825, Actor826, Actor827, Actor828, Actor829, Actor830, Actor831, Actor832, Actor833, Actor834, Actor835, Actor836, Actor837, Actor838, Actor839, 
   Actor840, Actor841, Actor842, Actor843, Actor844, Actor845, Actor846, Actor847, Actor848, Actor849, Actor850, Actor851, Actor852, Actor853, Actor854, Actor855, Actor856, Actor857, Actor858, Actor859, Actor860, Actor861, Actor862, Actor863, Actor864, Actor865, Actor866, Actor867, Actor868, Actor869, Actor870, Actor871, Actor872, Actor873, Actor874, Actor875, Actor876, Actor877, Actor878, Actor879, 
   Actor880, Actor881, Actor882, Actor883, Actor884, Actor885, Actor886, Actor887, Actor888, Actor889, Actor890, Actor891, Actor892, Actor893, Actor894, Actor895, Actor896, Actor897, Actor898, Actor899, Actor900, Actor901, Actor902, Actor903, Actor904, Actor905, Actor906, Actor907, Actor908, Actor909, Actor910, Actor911, Actor912, Actor913, Actor914, Actor915, Actor916, Actor917, Actor918, Actor919, 
   Actor920, Actor921, Actor922, Actor923, Actor924, Actor925, Actor926, Actor927, Actor928, Actor929, Actor930, Actor931, Actor932, Actor933, Actor934, Actor935, Actor936, Actor937, Actor938, Actor939, Actor940, Actor941, Actor942, Actor943, Actor944, Actor945, Actor946, Actor947, Actor948, Actor949, Actor950, Actor951, Actor952, Actor953, Actor954, Actor955, Actor956, Actor957, Actor958, Actor959, 
   Actor960, Actor961, Actor962, Actor963, Actor964, Actor965, Actor966, Actor967, Actor968, Actor969, Actor970, Actor971, Actor972, Actor973, Actor974, Actor975, Actor976, Actor977, Actor978, Actor979, Actor980, Actor981, Actor982, Actor983, Actor984, Actor985, Actor986, Actor987, Actor988, Actor989, Actor990, Actor991, Actor992, Actor993, Actor994, Actor995, Actor996, Actor997, Actor998, Actor999, 
   Actor1000, Actor1001, Actor1002, Actor1003, Actor1004, Actor1005, Actor1006, Actor1007, Actor1008, Actor1009, Actor1010, Actor1011, Actor1012, Actor1013, Actor1014, Actor1015, Actor1016, Actor1017, Actor1018, Actor1019, Actor1020, Actor1021, Actor1022, Actor1023, Actor1024, Actor1025, Actor1026, Actor1027, Actor1028, Actor1029, Actor1030, Actor1031, Actor1032, Actor1033, Actor1034, Actor1035, Actor1036, Actor1037, Actor1038, Actor1039, 
   Actor1040, Actor1041, Actor1042, Actor1043, Actor1044, Actor1045, Actor1046, Actor1047, Actor1048, Actor1049, Actor1050, Actor1051, Actor1052, Actor1053, Actor1054, Actor1055, Actor1056, Actor1057, Actor1058, Actor1059, Actor1060, Actor1061, Actor1062, Actor1063, Actor1064, Actor1065, Actor1066, Actor1067, Actor1068, Actor1069, Actor1070, Actor1071, Actor1072, Actor1073, Actor1074, Actor1075, Actor1076, Actor1077, Actor1078, Actor1079, 
   Actor1080, Actor1081, Actor1082, Actor1083, Actor1084, Actor1085, Actor1086, Actor1087, Actor1088, Actor1089, Actor1090, Actor1091, Actor1092, Actor1093, Actor1094, Actor1095, Actor1096, Actor1097, Actor1098, Actor1099, Actor1100, Actor1101, Actor1102, Actor1103, Actor1104, Actor1105, Actor1106, Actor1107, Actor1108, Actor1109, Actor1110, Actor1111, Actor1112, Actor1113, Actor1114, Actor1115, Actor1116, Actor1117, Actor1118, Actor1119, 
   Actor1120, Actor1121, Actor1122, Actor1123, Actor1124, Actor1125, Actor1126, Actor1127, Actor1128, Actor1129, Actor1130, Actor1131, Actor1132, Actor1133, Actor1134, Actor1135, Actor1136, Actor1137, Actor1138, Actor1139, Actor1140, Actor1141, Actor1142, Actor1143, Actor1144, Actor1145, Actor1146, Actor1147, Actor1148, Actor1149, Actor1150, Actor1151, Actor1152, Actor1153, Actor1154, Actor1155, Actor1156, Actor1157, Actor1158, Actor1159, 
   Actor1160, Actor1161, Actor1162, Actor1163, Actor1164, Actor1165, Actor1166, Actor1167, Actor1168, Actor1169, Actor1170, Actor1171, Actor1172, Actor1173, Actor1174, Actor1175, Actor1176, Actor1177, Actor1178, Actor1179, Actor1180, Actor1181, Actor1182, Actor1183, Actor1184, Actor1185, Actor1186, Actor1187, Actor1188, Actor1189, Actor1190, Actor1191, Actor1192, Actor1193, Actor1194, Actor1195, Actor1196, Actor1197, Actor1198, Actor1199}

frame_tick = 0
counter = 0
player = 0
MainObjective = 0
wait_ticks = 100

MissionAccomplished = function()
	Media.PlaySpeechNotification(player, "MissionAccomplished")
end

MissionFailed = function()
	Media.PlaySpeechNotification(player, "MissionFailed")
end

SetBlack = function(pbox)
   pbox.GrantCondition('dummy', 1)
end

SetWhite = function(pbox)
   pbox.GrantCondition('color_w', 1)
end

SetFrame = function(frame_id, frame)
	for i = 1, 1200, 1
	do
		if(frame[i + frame_id * 1200] == 0)
		then
			SetBlack(pboxs[i])
      else
         SetWhite(pboxs[i])
		end
	end
end


Tick = function()
   Camera.Position = camera.CenterPosition
   if wait_ticks > 0
   then
      wait_ticks = wait_ticks - 1
      SetFrame(0, frame_6)
      return
   end 
	frame_tick = frame_tick + 1
      if(counter < 400)
      then
         SetFrame(counter, frame_4)
         counter = counter + 1
      else if(counter < 800)
         then
            SetFrame(counter - 400, frame_5)
            counter = counter + 1
         else if(counter < 1200)
            then
               SetFrame(counter - 800, frame_6)
               counter = counter + 1
            else
               SetFrame(0, frame_4)
            end
         end
      end
end

WorldLoaded = function()
	player = Player.GetPlayer("Player")
   SetFrame(0, frame_6)
end
